package meng.spring.test8.annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @describe: 类描述信息
 * @author: morningcat.zhang
 * @date: 2019/9/16 6:18 PM
 */
public class Test2 {

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AnnotationConfig.class);

        /**
         *
         */
        BeanAnnotation beanAnnotation = context.getBean("beanAnnotation",
                BeanAnnotation.class);
        beanAnnotation.say("Hello 注解bean");
        System.out.println(beanAnnotation.hashCode());

        BeanAnnotation beanAnnotation2 = context.getBean("beanAnnotation",
                BeanAnnotation.class);
        beanAnnotation2.say("Hello 注解bean");
        System.out.println(beanAnnotation2.hashCode());
    }
}
